home *** CD-ROM | disk | FTP | other *** search
/ Interactive Media Design Review 1999 / Interactive Media Design Review 1999.iso / pc / Demos / Bombardier_PC / DATACH.CST / 00056_Script_calc fields < prev    next >
Text File  |  1999-03-07  |  2KB  |  52 lines

  1. on exitFrame
  2.   global default_fuel, default_labor
  3.   set d_f = losemoney(the text of field "defaultfuel")
  4.   --  if integerp(d_f) or floatp(d_f) then
  5.   if value(d_f) > 1000000 then
  6.     getocdefaults
  7.     set d_f = losemoney(the text of field "defaultfuel")
  8.   end if
  9.   if value(d_f) < 0 then
  10.     getocdefaults
  11.     set d_f = losemoney(the text of field "defaultfuel")
  12.   end if
  13.   if default_fuel <> value(d_f) then
  14.     set the text of field "defaultfuel" = "$ " & d_f
  15.     set the selstart to length(the text of field "defaultfuel")
  16.     set default_fuel = value(d_f)
  17.     mainbars
  18.     set lx = length(the text of field "displane")
  19.     if (lx > 2) and (the text of field "displane"<>"No Competitor")  then
  20.       compbars the text of field "displane"
  21.     end if
  22.   end if
  23.   --  else
  24.   --    alert("enter a number for fuel")
  25.   --    set the text of field "defaultfuel" = "0"
  26.   --  end if
  27.   set d_l = losemoney(the text of field "defaultlabor")
  28.   if value(d_l) > 10000000 then
  29.     getocdefaults
  30.     set d_l = losemoney(the text of field "defaultlabor")
  31.   end if
  32.   --  if integerp(d_l) or floatp(d_l) then
  33.   if default_labor <> value(d_l) then
  34.     set the text of field "defaultlabor" = "$ " & d_l
  35.     set the selstart to length(the text of field "defaultlabor")
  36.     set default_labor = value(d_l)
  37.     mainbars
  38.     if the number of chars in the text of field "displane" > 2 then
  39.       compbars (the text of field "displane")
  40.     end if
  41.   end if
  42.   --  else
  43.   --    alert("enter a number for labor")
  44.   --    set the text of field "defaultlabor" = "0"
  45.   --  end if
  46.   repeat with i = 34 to 38.
  47.     puppetsprite i, false
  48.     set the visible of sprite i = true
  49.   end repeat
  50.   updatestage
  51.   go to the frame
  52. end